<template>
	<view>
		<view style="padding: 30rpx; text-align: right;"> <uni-button size="mini"  type="primary" @click="addShop()">新增店铺</uni-button></view>
		<view class="">
			<uni-card v-for="(item, index) in dataList" :key="index" :title="item.shop_name" >
				<text class="uni-body">产品：</text>
				<text class="uni-body">员工：</text>
				<text class="uni-body">库存：</text>
			</uni-card>
		</view>
	</view>
</template>
<script>
	import api from "@/utils/api.js";
	export default {
		data() {
			return {
				dataList: []
			}
		},
		onShow() {
			this.fetchData();
		},
		methods: {
			addShop(){
				uni.navigateTo({
					url: "/pages/kucun/shop/add"
				})
			},
			async fetchData(){
				let { result } = await api.shopList();
				console.log(result)
				this.dataList = result['data']['list']
			}
		}
	}
</script>

<style>

</style>
